home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
DISPCDOS.MOD
< prev
next >
Wrap
Text File
|
1987-09-22
|
6KB
|
132 lines
(*----------------------------------------------------------------------*)
(* Display_Character_Through_DOS --- show character received from port *)
(*----------------------------------------------------------------------*)
PROCEDURE Display_Character_Through_DOS( Ch: CHAR );
(*----------------------------------------------------------------------*)
(* *)
(* Procedure: Display_Character_Through_Dos *)
(* *)
(* Purpose: Displays character received from comm. port on *)
(* screen/printer/capture file. *)
(* *)
(* Calling Sequence: *)
(* *)
(* Display_Character_Through_Dos( Ch : CHAR ); *)
(* *)
(* Ch --- Character received from Comm. port. *)
(* *)
(* Calls: Capture_Char *)
(* Update_Review_Pointers *)
(* *)
(*----------------------------------------------------------------------*)
VAR
I : INTEGER;
BEGIN (* Display_Character_Through_DOS *)
(* Select display depending on *)
(* character. *)
CASE ORD( Ch ) OF
CR : IF Add_LF THEN
BEGIN
IF Capture_On THEN
Capture_Char( CHR( LF ) );
IF Printer_On THEN
WRITE( Lst , CHR( CR ) , CHR( LF ) );
INLINE(
$B4/$02 { MOV AH,2 ;DOS display character function}
/$B2/<CR { MOV DL,<CR ;Character to display}
/$CD/$21 { INT $21 ;Call DOS}
);
INLINE(
$B4/$02 { MOV AH,2 ;DOS display character function}
/$B2/<LF { MOV DL,<LF ;Character to display}
/$CD/$21 { INT $21 ;Call DOS}
);
IF Review_On THEN
Update_Review_Pointers;
END
ELSE
BEGIN
INLINE(
$B4/$02 { MOV AH,2 ;DOS display character function}
/$B2/<CR { MOV DL,<CR ;Character to display}
/$CD/$21 { INT $21 ;Call DOS}
);
IF Printer_On THEN
WRITE( Lst , CHR( CR ) );
END;
LF : IF NOT Add_LF THEN
BEGIN
IF Capture_On THEN
Capture_Char( CHR( LF ) );
INLINE(
$B4/$02 { MOV AH,2 ;DOS display character function}
/$B2/<LF { MOV DL,<LF ;Character to display}
/$CD/$21 { INT $21 ;Call DOS}
);
IF Printer_On THEN
WRITE( Lst , CHR( LF ) );
IF Review_On THEN
Update_Review_Pointers;
END;
VT, FF: BEGIN
IF Capture_On THEN
Capture_Char( Ch );
IF Printer_On THEN
WRITE( Lst , Ch );
INLINE(
$B4/$02 { MOV AH,2 ;DOS display character function}
/$8A/$56/<CH { MOV DL,[BP+<Ch] ;Character to display}
/$CD/$21 { INT $21 ;Call DOS}
);
IF Review_On THEN
Update_Review_Pointers;
END;
ELSE BEGIN
INLINE(
$B4/$02 { MOV AH,2 ;DOS display character function}
/$8A/$56/<CH { MOV DL,[BP+<Ch] ;Character to display}
/$CD/$21 { INT $21 ;Call DOS}
);
IF Capture_On THEN
Capture_Char( Ch );
IF Printer_On THEN
WRITE( Lst , Ch );
IF Review_On THEN
BEGIN
I := SUCC( ORD( Review_Line[0] ) );
IF ( I < Max_Review_Line_Length ) THEN
BEGIN
Review_Line[I] := Ch;
Review_Line[0] := CHR( I );
END;
END;
END;
END;
END (* Display_Character_Through_Dos *);